package com.zhanqiao.Dao;

import com.zhanqiao.Utils.GetDataSourceUtil;
import org.apache.commons.dbutils.QueryRunner;
import sun.security.util.Length;

import javax.sql.DataSource;
import java.sql.SQLException;

public class AdminDao {
    public  void getAdmidata( Object []objects) throws SQLException {
        DataSource dataSource= GetDataSourceUtil.getDataSource();
        QueryRunner queryRunner = new QueryRunner(dataSource);
        Object temp = new Object();
        temp = objects[0];
        for (int i = 0; i < objects.length - 1; i++) {
            objects[i] = objects[i + 1];
        }
        objects[objects.length - 1] = temp;
        queryRunner.update("update admin set city1=?,city2=?,city3=?,asex=?,asign=? where aname=?" ,objects);
//    queryRunner.update("insert into admin(aname) values('安弟')");
    }


}
